;---------------------------------------------------------------------------
;Irene Stand Summon (Entrance)
[Statedef 7000]
type    = A
movetype= I
physics = N
velset = ifelse(parent,BackEdgeDist > 30,(ParentDist X + 20)/15,(ParentDist X)/15),-3.33
ctrl = 0
anim = 7000
sprpriority = 3

[State 7000, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7000, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7000, 3]
type = Null
trigger1 = !Time
var(7) = -100-(50*(root,Var(0) > 0))

[State 7000, 4]
type = ParentVarSet
trigger1 = !Time && RoundState = 2
var(38) = 1

[State 7000, 5]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP
stateno = 7030
time = -1

[State 7000, 6]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP
time = 1

[State 7000, 7]
type = Gravity
trigger1 = 1

[State 7000, 8]
type = PlaySnd
trigger1 = !Time
value = S40,0

[State 7000, 9]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y > -Vel Y
value = 7001
;---------------------------------------------------------------------------
;Irene Stand Summon (Land)
[Statedef 7001]
type    = A
movetype= I
physics = N
velset = 0,0
ctrl = 0
anim = 7001
sprpriority = 3

[State 7001, 1]
type = PosSet
trigger1 = !Time
y = 0

[State 7001, 2]
type = ScreenBound
trigger1 = 1
value = 0

[State 7001, 3] 
type = PlayerPush
trigger1 = 1
value = 0

[State 7001, 4]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP
stateno = 7030
time = -1

[State 7001, 5]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP
time = 1

[State 7001, 6]
type = ChangeState
trigger1 = !AnimTime
value = 7002
;---------------------------------------------------------------------------
;Irene Stand Summon (Shoot)
[Statedef 7002]
type    = S
movetype= A
physics = N
velset = 0,0
ctrl = 0
anim = 7002
sprpriority = 3

[State 7002, 1]
type = PosSet
trigger1 = !Time
y = 0

[State 7002, 2]
type = ScreenBound
trigger1 = 1
value = 0

[State 7002, 3]
type = PlayerPush
trigger1 = 1
value = 0

[State 7002, 4]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP
stateno = 7030
time = -1

[State 7002, 5]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP
time = 1

[State 7002, 6]
type = HitDef
trigger1 = AnimElem = 2
attr = S, SA
damage = ceil(20*root,fvar(21)),5
animtype = Medium
guardflag = MAF
hitflag = MAF
getpower = 0,0
priority = 4, Hit
pausetime = 1,5
sparkno = S6001
sparkxy = -9,-41
hitsound = F5, 2
guardsound = F6, 0
ground.type = High
ground.slidetime = 11
ground.hittime  = 33
guard.hittime  = 10
ground.velocity = -3.8
ground.cornerpush.veloff = 0
air.type = High
air.velocity = -3.8,-2.1
air.hittime = 28
fall = 1
fall.recover = 0
id = 7000
chainID = -1
nochainID = -1
hitonce = 0
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1

[State 7002, 7]
type = Null
triggerall = NumTarget && MoveHit
trigger1 = root,Cond(FVar(20) > .3, FVar(20) := FVar(20) - .2,0) || root,Cond(FVar(21) > .3, FVar(21) := FVar(21) - .2,0)
ignorehitpause = 1
persistent = 0

[State 7002, 8]
type = PlaySnd
trigger1 = AnimElem = 2
value = S7000,0

[State 7002, 9]
type = ChangeState
trigger1 = Time = 24
value = 7003
;---------------------------------------------------------------------------
;Helper1 Stand Summon (Recover)
[Statedef 7003]
type    = S
movetype= I
physics = N
velset = 0,0
ctrl = 0
anim = 7003
sprpriority = 3

[State 7003, 1]
type = PosSet
trigger1 = !Time
y = 0

[State 7003, 2]
type = ScreenBound
trigger1 = 1
value = 0

[State 7003, 3]
type = PlayerPush
trigger1 = 1
value = 0

[State 7003, 4]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP
stateno = 7030
time = -1

[State 7003, 5]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP
time = -1

[State 7003, 6]
type = ChangeState
trigger1 = !AnimTime
value = 7004

;---------------------------------------------------------------------------
;Irene Stand Summon (Leave)
[Statedef 7004]
type    = A
movetype= I
physics = N
ctrl = 0
velset = -10, -9.13
anim = 7000
sprpriority = 3

[State 7004, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7004, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7004, 3]
type = NotHitBy
trigger1 = 1
value = SCA,AA,AP,AT
time = -1

[State 7004, 4]
type = Gravity
trigger1 = Time >= 14

[State 7004, 5]
type = PlaySnd
trigger1 = !Time
value = S40,0

[State 7004, 6]
type = ChangeState
trigger1 = BackEdgeDist < -30
value = 7300
;---------------------------------------------------------------------------
;Irene Crouch Summon (Entrance)
[Statedef 7010]
type    = A
movetype= I
physics = N
velset = ifelse(parent,BackEdgeDist > 30,(ParentDist X + 20)/15,(ParentDist X)/15),-3.33
ctrl = 0
anim = 7010
sprpriority = 3

[State 7010, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7010, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7010, 3]
type = Null
trigger1 = !Time
var(7) = -50-(50*(root,Var(0) > 0))

[State 7010, 4]
type = ParentVarSet
trigger1 = !Time && RoundState = 2
var(38) = 1

[State 7010, 5]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP
stateno = 7030
time = -1

[State 7010, 6]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP
time = 1

[State 7010, 7]
type = Gravity
trigger1 = 1

[State 7010, 8]
type = PlaySnd
trigger1 = !Time
value = S40,0

[State 7010, 9]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y > -Vel Y
value = 7011
;---------------------------------------------------------------------------
;Irene Crouch Summon (Shoot)
[Statedef 7011]
type    = A
movetype= I
physics = N
velset = 0,0
ctrl = 0
anim = 7011
sprpriority = 3

[State 7011, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7011, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7011, 3]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP
stateno = 7030
time = -1

[State 7011, 4]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP
time = -1

[State 7011, 5]
type = Helper
trigger1 = AnimElem = 4
name = "Bullet"
ID = 7050
stateno = 7013 
pos = 38,-38
postype = p1
facing = 1
keyctrl = 0
ownpal = 1

[State 7011, 6]
type = ParentVarSet
trigger1 = AnimElem = 4
var(39) = 1

[State 7011, 7]
type = VarAdd
trigger1 = AnimElem = 4
var(11) = 1

[State 7011, 8]
type = StateTypeSet
trigger1 = Time = 10
movetype = A

[State 7011, 9]
type = StateTypeSet
trigger1 = Time = 12
movetype = I

[State 7011, 10]
type = PlaySnd
trigger1 = AnimElem = 4
value = S7010,0

[State 7011, 11]
type = ChangeState
trigger1 = !AnimTime
value = 7012
;---------------------------------------------------------------------------
;Irene Crouch Summon (Leave)
[Statedef 7012]
type    = A
movetype= I
physics = N
ctrl = 0
velset = -10, -9.13
anim = 7012
sprpriority = 3

[State 7004, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7004, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7004, 3]
type = NotHitBy
trigger1 = 1
value = SCA,AA,AP,AT
time = -1

[State 7004, 4]
type = Gravity
trigger1 = Time >= 14

[State 7004, 5]
type = PlaySnd
trigger1 = !Time
value = S40,0

[State 7004, 6]
type = ChangeState
trigger1 = BackEdgeDist < -30
value = 7300
;---------------------------------------------------------------------------
;Bullet
[Statedef 7013]
type    = S
movetype= A
physics = N
ctrl = 0
velset = 10.3
anim = 7013
sprpriority = 3

[State 7013, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7013, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7013, 3]
type = HitBy
trigger1 = 1
value = SCA,HA,NP,SP,HP
time = -1

[State 7013, 4]
type = HitOverride
trigger1 = 1
attr = SCA,HA,NP,SP,HP
slot = 0
stateno = 7014
time = -1

[State 7013, 5]
type = HitDef
trigger1 = !Time
attr = S, SP
damage = ceil(90*root,fvar(21)),23
animtype = Hard
guardflag = MAF
hitflag = MAF
priority = 4, Hit
pausetime = 1,1
sparkno = -1
hitsound = F5, 1
guardsound = F6, 0
ground.type = High
ground.slidetime = 18
ground.hittime  = 22
guard.slidetime = 15
guard.hittime = 18
ground.velocity = -6.1
ground.cornerpush.veloff = 0
air.type = High
air.velocity = -5.4,-3.8
air.hittime = 15
fall = 1
fall.recover = 0
id = 7010
chainID = -1
nochainID = -1
hitonce = 0
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1

[State 7013, 6]
type = Null
triggerall = NumTarget && MoveHit && HitPauseTime = 1
trigger1 = root,Cond(FVar(20) > .3, FVar(20) := FVar(20) - .2,0) || root,Cond(FVar(21) > .3, FVar(21) := FVar(21) - .2,0)
ignorehitpause = 1
persistent = 0

[State 7013, 7]
type = VarSet
trigger1 = 1
fvar(1) = P2BodyDist X 

[State 7013, 8]
type = VarSet
trigger1 = 1
fvar(2) = P2BodyDist Y 

[State 7013, 9]
type = ChangeState
trigger1 = MoveContact
value = 7014

[State 7013, 10]
type = ChangeState
trigger1 = FrontEdgeDist < -40
value = 7015
;-------------------------------------------------------------------------
;Bullet Explod
[Statedef 7014]
type    = S
movetype= A
physics = N
ctrl = 0
velset = 0,0
anim = 6001

[State 7103, 1]
type = ChangeAnim
trigger1 = Anim = 6001 && !AnimTime
value = 1

[State 7103, 2]
type = ParentVarAdd
trigger1 = !Time
var(10) = 1

[State 7103, 3]
type = DestroySelf
triggerall = parent,Var(10)
trigger1 = !NumTarget && Anim = 1
trigger2 = NumTarget && Anim = 1
trigger2 = target,StateType = L
;-------------------------------------------------------------------------
;Bullet Gone
[Statedef 7015]
type    = S
movetype= A
physics = N
ctrl = 0
velset = 0,0
anim = 1

[State 7104, 1]
type = ParentVarAdd
trigger1 = !Time
var(10) = 1

[State 7104, 2]
type = DestroySelf
triggerall = parent,Var(10)
trigger1 = !NumTarget && Anim = 1
trigger2 = NumTarget && Anim = 1
trigger2 = target,StateType = L
;---------------------------------------------------------------------------
; Irene Hit
[Statedef 7030]
type    = A
movetype= H
physics = N
ctrl = 0
velset = -2,-4.5
anim = 7030
sprpriority = 3

[State 7030, 1]
type = ParentVarAdd
trigger1 = !Time 
var(6) = -100
ignorehitpause = 1

[State 7030, 2]
type = Gravity
trigger1 = 1

[State 7030, 3]
type = ChangeState
triggerall = root,Var(6)
trigger1 = Vel Y > 0 && Pos Y > -Vel Y
value = 7031

[State 7030, 4]
type = ChangeState
triggerall = root,Var(6) = 0
trigger1 = Vel Y > 0 && Pos Y > -Vel Y
value = 7040
;---------------------------------------------------------------------------
; Irene Recover
[Statedef 7031]
type    = S
movetype= H
physics = N
ctrl = 0
velset = 0,0
anim = 7031
sprpriority = 3

[State 7031, 1]
type = PosSet
trigger1 = !Time
y = 0

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = AnimElem = 3
statetype = A       ;S,A,C,L

[State 0, VelSet]
type = VelSet
trigger1 = AnimElem = 3
x = -10 
y = -9.13

[State 7004, 4]
type = Gravity
trigger1 = Time >= 19

[State 7004, 5]
type = PlaySnd
trigger1 = AnimElem = 3
value = S40,0

[State 7004, 6]
type = ChangeState
trigger1 = BackEdgeDist < -30
value = 7300
;---------------------------------------------------------------------------
; Irene Dead and will probably come back alive somehow 
[Statedef 7040]
type    = S
movetype= H
physics = N
sprpriority = -3
velset = 0,0
anim = 7040
ctrl = 0

[State 7040, 1]
type = PosSet
trigger1 = !Time
y = 0

[State 7040, 2]
type = PlaySnd
trigger1 = !Time
value = S7040,0

[State 7040, 3]
type = DestroySelf
trigger1 = Time = 110
;---------------------------------------------------------------------------
;Rygar Stand Summon (Entrance)
[Statedef 7100]
type    = A
movetype= I
physics = N
velset = ifelse(parent,BackEdgeDist > 30,(ParentDist X + 20)/15,(ParentDist X)/15),-3.33
ctrl = 0
anim = 7100
sprpriority = 3

[State 7100, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7100, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7100, 3]
type = Null
trigger1 = !Time
var(7) = -50-(50*(root,Var(0) > 0))

[State 7100, 4]
type = ParentVarSet
trigger1 = !Time && RoundState = 2
var(38) = 1

[State 7100, 5]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP
stateno = 7130
time = -1

[State 7100, 6]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP
time = -1

[State 7100, 7]
type = Gravity
trigger1 = 1

[State 7100, 8]
type = PlaySnd
trigger1 = !Time
value = S7100,0

[State 7100, 9]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y > -Vel Y
value = 7101
;---------------------------------------------------------------------------
;Rygar Stand Summon (Throw)
[Statedef 7101]
type    = S
movetype= I
physics = N
velset = 0,0
ctrl = 0
anim = 7101
sprpriority = 3

[State 7101, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7101, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7101, 3]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP
stateno = 7130
time = -1

[State 7101, 4]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP
time = -1

[State 7101, 5]
type = PosSet
trigger1 = !Time 
y = 0

[State 7101, 6]
type = Helper
trigger1 = AnimElem = 5
name = "Discarmor"
ID = 7050
stateno = 7102
pos = 57,-44
postype = p1
facing = 1
keyctrl = 0
ownpal = 1

[State 7101, 7]
type = ParentVarSet
trigger1 = AnimElem = 5
var(39) = 1

[State 7101, 8]
type = VarAdd
trigger1 = AnimElem = 5
var(11) = 1

[State 7101, 9]
type = StateTypeSet
trigger1 = Time = 24
movetype = A

[State 7101, 10]
type = StateTypeSet
trigger1 = Time = 26
movetype = I

[State 7101, 11]
type = PlaySnd
trigger1 = AnimElem = 5
value = S7101,0

[State 7101, 12]
type = ChangeState
trigger1 = !NumHelper(7050) && Time > 26
value = 7103
;---------------------------------------------------------------------------
;Discarmor
[Statedef 7102]
type    = S
movetype= A
physics = N
velset = 8.1,0
ctrl = 0
anim = 7102
sprpriority = 3

[State 7102, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7102, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7102, 3]
type = VelSet
trigger1 = Time = 17
x = -8.1

[State 7102, 4]
type = HitDef
trigger1 = !Time
attr = S,SA
damage = ceil(150*root,fvar(21)),38
animtype = Hard
guardflag = MAF
hitflag = MAF
getpower = 0,0
priority = 4, Miss
pausetime = 1,1
sparkno = S6001
hitsound = F5,3
guardsound = F6, 0
ground.type = High
ground.slidetime = 11
ground.hittime  = 28
guard.hittime  = 10
ground.velocity = -7.2
ground.cornerpush.veloff = 0
air.type = High
air.velocity = -6, -4.4
air.hittime = 15
fall = 1
fall.recover = 0
id = 7100
chainID = -1
nochainID = -1
hitonce = 0
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1

[State 7102, 5]
type = Null
triggerall = NumTarget && MoveHit && HitPauseTime = 1
trigger1 = root,Cond(FVar(20) > .3, FVar(20) := FVar(20) - .2,0) || root,Cond(FVar(21) > .3, FVar(21) := FVar(21) - .2,0)
ignorehitpause = 1
persistent = 0

[State 7102, 6]
type = ChangeState
trigger1 = parent,StateNo != 7101
trigger2 = ParentDist X >= -57 && Time
value = 7015
;---------------------------------------------------------------------------
;Rygar Stand Summon (Discarmor Retrieved)
[Statedef 7103]
type    = S
movetype= I
physics = N
velset = 0,0
ctrl = 0
anim = 7103
sprpriority = 3

[State 7103, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7103, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7103, 3]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP
stateno = 7130
time = -1

[State 7103, 4]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP
time = -1

[State 7103, 5]
type = ChangeState
trigger1 = !AnimTime 
value = 7120
;---------------------------------------------------------------------------
;Rygar Crouch Summon (Entrance)
[Statedef 7110]
type    = S
movetype= I
physics = N
velset = ifelse(parent,BackEdgeDist > 30,(ParentDist X + 20)/15,(ParentDist X)/15),-3.33
ctrl = 0
anim = 7100
sprpriority = 3

[State 7110, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7110, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7110, 3]
type = Null
trigger1 = !Time
var(7) = -50-(50*(root,Var(0) > 0))

[State 7110, 4]
type = Gravity
trigger1 = 1

[State 7110, 5]
type = ParentVarSet
trigger1 = !Time && RoundState = 2
var(38) = 1

[State 7110, 6]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP
stateno = 7130
time = -1

[State 7100, 7]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP
time = -1

[State 7110, 8]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y > -Vel Y
value = 7111
;---------------------------------------------------------------------------
;Rygar Crouch Summon (Crossbow)
[Statedef 7111]
type    = S
movetype= I
physics = N
velset = 0,0
ctrl = 0
anim = 7111
sprpriority = 3

[State 7111, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7111, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7111, 3]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP
stateno = 7130
time = -1

[State 7111, 4]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP
time = -1

[State 7111, 5]
type = PosSet
trigger1 = !Time 
y = 0

[State 7111, 6]
type = Helper
trigger1 = AnimElem = 6
name = "Arrow"
ID = 7050
stateno = 7114
pos = 86,-47
postype = p1
facing = 1
keyctrl = 0
ownpal = 0

[State 7111, 7]
type = ParentVarSet
trigger1 = AnimElem = 5
var(39) = 1

[State 7111, 8]
type = VarAdd
trigger1 = AnimElem = 5
var(11) = 1

[State 7111, 9]
type = StateTypeSet
trigger1 = Time = 22
movetype = A

[State 7111, 10]
type = StateTypeSet
trigger1 = Time = 24
movetype = I

[State 7111, 11]
type = ChangeState
trigger1 = NumHelper(7050)
trigger1 = helper(7050), StateNo = 7115
trigger2 = !Numhelper(7050) && Time >= 25
value = 7112
;---------------------------------------------------------------------------
;Rygar Crouch Summon (Pull)
[Statedef 7112]
type    = S
movetype= I
physics = N
velset = 0,0
ctrl = 0
anim = 7112
sprpriority = 3

[State 7112, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7112, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7112, 3]
type = HitOverride
trigger1 = !NumHelper(7050)
attr = SCA,NA,SA,HA,NP,SP,HP
stateno = 7130
time = -1

[State 7112, 4]
type = HitBy
trigger1 = !NumHelper(7050)
value = SCA,NA,SA,HA,NP,SP,HP
time = -1

[State 7112, 5]
type = NotHitBy
trigger1 = NumHelper(7050)
value = SCA
time = 1

[State 0, PosAdd]
type = PosAdd
trigger1 = AnimElem = 2
trigger2 = !AnimTime
x = -6+12*(!AnimTime)

[State 0, PosAdd]
type = PosAdd
trigger1 = AnimElem = 3
trigger2 = AnimElem = 6
x = -4+8*(AnimElem = 6)

[State 0, PosAdd]
type = PosAdd
trigger1 = AnimElem = 4
trigger2 = AnimElem = 5
x = -2+4*(AnimElem = 5)

[State 7112, 6]
type = PlaySnd
trigger1 = AnimElem = 4
value = S7111,1

[State 7112, 7]
type = ChangeState
trigger1 = !AnimTime
value = 7120
;---------------------------------------------------------------------------
;Arrow
[Statedef 7114]
type    = S
movetype= A
physics = N
velset = 5.6,0
ctrl = 0
anim = 7114
sprpriority = 3

[State 7114, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7114, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7114, 3]
type = HitOverride
trigger1 = 1
attr = SCA,SP,HP
stateno = 7013
time = -1

[State 7114, 4]
type = HitBy
trigger1 = 1
value = SCA,SP,HP
time = -1

[State 7114, 5]
type = HitDef
trigger1 = !Time
attr = S,HP
hitflag = MAF
guardflag = MA
getpower = 0,0
animtype = Hard
priority = 4,Hit
getpower = 0,0
damage = ceil(75*root,fvar(21)),19
pausetime = 4,4
sparkno = S6001
sparkxy = -1,-1*floor(const(size.yscale))
hitsound = F5,2
guardsound = F6,0
ground.type = High
ground.slidetime = 15
ground.hittime  = 19
guard.hittime = 15
ground.cornerpush.veloff = 0
fall = 1
fall.recover = 0
id = 3000
chainID = -1
nochainID = -1
p1stateno = 7115

[State 7114, 6]
type = Null
triggerall = NumTarget && MoveHit && HitPauseTime = 1
trigger1 = root,Cond(FVar(20) > .3, FVar(20) := FVar(20) - .2,0) || root,Cond(FVar(21) > .3, FVar(21) := FVar(21) - .2,0)
ignorehitpause = 1
persistent = 0

[State 7114, 7]
type = PlaySnd
trigger1 = !Time
value = S7111,0
channel = 3

[State 7114, 8]
type = ChangeState
trigger1 = MoveGuarded
trigger2 = Time = 50
trigger3 = parent,StateNo != 7111
value = 7015
;---------------------------------------------------------------------------
;Arrow Hit
[Statedef 7115]
type    = S
movetype= A
physics = N
velset = 0,0
ctrl = 0
anim = 7114
sprpriority = 3

[State 7115, 1]
type = TargetState
triggerall = NumTarget
trigger1 = !Time
value = 7116

[State 7115, 2]
type = TargetState
triggerall = NumTarget
trigger1 = parent,StateNo = 7112
trigger1 = parent,AnimElem = 4
value = 7117

[State 7115, 3]
type = TargetState
triggerall = NumTarget
trigger1 = parent,StateNo = 7030
value = 7118

[State 7115, 4]
type = StopSnd
trigger1 = !Time
channel = 3

[State 7115, 6]
type = ChangeAnim
trigger1 = parent,StateNo = 7030
trigger2 = parent,StateNo = 7112
trigger2 = parent,AnimElem = 4
value = 1
ignorehitpause = 1

[State 7115, 6]
type = ParentVarAdd
trigger1 = !Time
var(10) = 1

[State 7115, 7]
type = DestroySelf
triggerall = Time
trigger1 = !NumTarget && Anim = 1
trigger2 = NumTarget && Anim = 1
trigger2 = target,StateType = L
;---------------------------------------------------------------------------
;P2 Caught
[Statedef 7116]
type    = A
movetype= H
physics = N
velset = 0,0
ctrl = 0
sprpriority = 3

[State 7116, 1]
type = ChangeAnim
trigger1 = !Time
value = 5000
;---------------------------------------------------------------------------
;P2 Pulled
[Statedef 7117]
type    = A
movetype= H
physics = N
velset = 6.8,-4.2
ctrl = 0
sprpriority = 3

[State 7117, 1]
type = ChangeAnim
trigger1 = !Time
value = 5070

[State 7117, 2]
type = Gravity
trigger1 = 1

[State 7117, 3]
type = SelfState
trigger1 = Vel Y > 0 && Pos Y > -Vel Y
value = 5110
;---------------------------------------------------------------------------
;P2 Dropped
[Statedef 7118]
type    = A
movetype= H
physics = N
ctrl = 0
sprpriority = 3

[State 7118, 1]
type = SelfState
trigger1 = !Time
value = 5035
;---------------------------------------------------------------------------
;Rygar Leave
[Statedef 7120]
type    = A
movetype= I
physics = N
ctrl = 0
velset = -10, -9.13
anim = 7100
sprpriority = 3

[State 7120, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7120, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7120, 3]
type = NotHitBy
trigger1 = 1
value = SCA,AA,AP,AT
time = -1

[State 7120, 4]
type = Gravity
trigger1 = Time >= 14

[State 7120, 5]
type = PlaySnd
trigger1 = !Time
value = S40,0

[State 7120, 6]
type = ChangeState
trigger1 = BackEdgeDist < -30
value = 7300
;---------------------------------------------------------------------------
;Rygar Hit
[Statedef 7130]
type    = A
movetype= H
physics = N
ctrl = 0
velset = -5.1,0
anim = 7130

[State 7130, 1]
type = AssertSpecial
trigger1 = (GameTime % 2) = 0
flag = invisible

[State 7130, 2]
type = ParentVarAdd
trigger1 = !Time 
var(6) =  -100
ignorehitpause = 1

[State 7130, 3]
type = PlaySnd
trigger1 = !Time
value = S7130,0

[State 7130, 4]
type = ChangeState
trigger1 = root,Var(6) && Time = 15
value = 7131

[State 7130, 5]
type = ChangeState
trigger1 = root,Var(6) = 0 && Time = 15
value = 7140
;---------------------------------------------------------------------------
;Rygar Recover
[Statedef 7131]
type    = A
movetype= H
physics = N
ctrl = 0
anim = 7100

[State 7131, 1]
type = AssertSpecial
trigger1 = (GameTime % 2) = 0
flag = invisible

[State 7131, 2]
type = Gravity
trigger1 = 1

[State 7131, 3]
type = PosSet
trigger1 = Pos Y >= 0
y = 0

[State 7131, 4]
type = ChangeState
triggerall = Time > 1
trigger1 = Vel Y >= 0 && Pos Y > -Vel Y
value = 7132
;---------------------------------------------------------------------------
;Rygar Land
[Statedef 7132]
type    = A
movetype= H
physics = N
ctrl = 0
velset = 0,0
anim = 7132

[State 7132, 1]
type = AssertSpecial
trigger1 = (GameTime % 2) = 0
flag = invisible

[State 7132, 2]
type = NotHitBy
trigger1 = 1
value = SCA,AA,SA,HA
time = 1

[State 7132, 3]
type = ChangeState
trigger1 = !AnimTime
value = 7120 
;---------------------------------------------------------------------------
;Rygar Defeated
[Statedef 7140]
type    = L
movetype= H
physics = N
sprpriority = -3
velset = 0,0
anim = 7140
ctrl = 0

[State 7140, 1]
type = AssertSpecial
triggerall = Time <= 90
trigger1 = (GameTime % 2) = 0
flag = invisible

[State 7140, 2]
type = DestroySelf
trigger1 = Time = 120
;---------------------------------------------------------------------------
;Bomb Jack Stand Summon (Entrance)
[Statedef 7200]
type    = A
movetype= I
physics = N
velset = ifelse(parent,BackEdgeDist > 30,(ParentDist X + 45)/15,(ParentDist X)/15),-3.33
ctrl = 0
anim = 7200
sprpriority = 3

[State 7200, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7200, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7200, 3]
type = Null
trigger1 = !Time
var(7) = -50-(50*(root,Var(0) > 0))

[State 7200, 4]
type = ParentVarSet
trigger1 = !Time && RoundState = 2
var(38) = 1

[State 7200, 5]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP
stateno = 7230
time = -1

[State 7200, 6]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP
time = -1

[State 7200, 7]
type = Gravity
trigger1 = 1

[State 7200, 8]
type = PlaySnd
trigger1 = !Time
value = S7200,0

[State 7200, 9]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y > -Vel Y
value = 7201
;---------------------------------------------------------------------------
;Bomb Jack Stand Summon (Wind Up)
[Statedef 7201]
type    = S
movetype= I
physics = N
velset = 0,0
ctrl = 0
anim = 7201
sprpriority = 3

[State 7201, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7201, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7201, 5]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP
stateno = 7230
time = -1

[State 7201, 6]
type = HitBy
trigger1 = !Time
value = SCA,NA,SA,HA,NP,SP,HP
time = 17

[State 7201, 7]
type = PosSet
trigger1 = !Time 
y = 0

[State 7201, 8]
type = NotHitBy
trigger1 = Time >= 17
value = SCA,AA,AP,AT
time = 1

[State 7201, 9]
type = AssertSpecial
triggerall = Time >= 17
trigger1 = (GameTime % 2) = 0
flag = invisible

[State 7201, 10]
type = PlaySnd
trigger1 = Time = 17
value = S7200,1
channel = 0

[State 0, PosAdd]
type = PosAdd
trigger1 = AnimElem = 4
x = -4

[State 0, PosAdd]
type = PosAdd
trigger1 = AnimElem = 5
x = -16

[State 0, PosAdd]
type = PosAdd
trigger1 = AnimElem = 6
x = -2

[State 0, PosAdd]
type = PosAdd
trigger1 = AnimElem = 7
x = 8

[State 0, PosAdd]
type = PosAdd
trigger1 = AnimElem = 8
x = 16

[State 7201, 11]
type = ChangeState
trigger1 = !AnimTime
value = 7202
;---------------------------------------------------------------------------
;Bomb Jack Stand Summon (Upper)
[Statedef 7202]
type    = A
movetype= A
physics = N
velset = 1.31,-15.7
ctrl = 0
anim = 7202
sprpriority = 3

[State 7202, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7202, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7202, 3]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP
stateno = 7230
time = -1

[State 7202, 4]
type = NotHitBy
trigger1 = !Time
value = SCA,AA,AP,AT
time = 2

[State 7202, 5]
type = HitBy
trigger1 = Time >= 2
value = SCA,NA,SA,HA,NP,SP,HP
time = 1

[State 7202, 6]
type = PlaySnd
trigger1 = !Time
value = S7200,0
channel = 0

[State 7202, 7]
type = PosAdd
trigger1 = !Time
x = 8

[State 7202, 8]
type = Gravity
trigger1 = 1

[State 7202, 9]
type = HitDef
trigger1 = !Time
attr = A, SA
damage = ceil(175*root,fvar(21)),44
animtype = Hard
guardflag = MA
hitflag = MAF
priority = 4, Hit
getpower = 0
pausetime = 1,1
sparkno = S6001
sparkxy = -9,-45*floor(const(size.yscale))
hitsound = F5, 4
guardsound = F6, 0
ground.type = High
ground.slidetime = 13
ground.hittime  = 16
guard.slidetime = 13
guard.hittime = 13
ground.velocity = -1.31, -16.7
air.type = High
air.velocity = -1.25, -15.5
air.hittime = 15
fall = 1
fall.recover = 0
hitonce = 0
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1
id = 7200
chainID = -1
nochainID = -1
hitonce = 0
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1

[State 7202, 10]
type = Null
triggerall = NumTarget && MoveHit
trigger1 = root,Cond(FVar(20) > .3, FVar(20) := FVar(20) - .2,0) || root,Cond(FVar(21) > .3, FVar(21) := FVar(21) - .2,0)
ignorehitpause = 1
persistent = 0

[State 7202, 11]
type = ChangeState
trigger1 = Vel Y > 0
value = 7203
;---------------------------------------------------------------------------
;Bomb Jack Stand Summon (Fall)
[Statedef 7203]
type    = A
movetype= I
physics = N
ctrl = 0
anim = 7203
sprpriority = 3

[State 7203, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7203, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7203, 3]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP
stateno = 7230
time = -1

[State 7203, 4]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP
time = -1

[State 7203, 5]
type = Gravity
trigger1 = 1

[State 7203, 7]
type = ChangeState
trigger1 = Pos Y >= -20
value = 7204
;---------------------------------------------------------------------------
;Bomb Jack Stand Summon (Land)
[Statedef 7204]
type    = S
movetype= I
physics = N
velset = 0,0
ctrl = 0
anim = 7204
sprpriority = 3

[State 7203, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7203, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7203, 3]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP
stateno = 7230
time = -1

[State 7203, 4]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP
time = -1

[State 7203, 5]
type = PosSet
trigger1 = !Time
y = 0

[State 7203, 6]
type = ChangeState
trigger1 = !AnimTime
value = 7220
;---------------------------------------------------------------------------
;Bomb Jack Crouch Summon (Entrance)
[Statedef 7210]
type    = S
movetype= I
physics = N
velset = ifelse(parent,BackEdgeDist > 30,(ParentDist X + 45)/15,(ParentDist X)/15),-3.33
ctrl = 0
anim = 7200
sprpriority = 3

[State 7211, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7211, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7211, 3]
type = Null
trigger1 = !Time
var(7) = -50-(50*(root,Var(0) > 0))

[State 7211, 4]
type = ParentVarSet
trigger1 = !Time && RoundState = 2
var(38) = 1

[State 7211, 5]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP
stateno = 7230
time = -1

[State 7211, 6]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP
time = -1

[State 7211, 7]
type = Gravity
trigger1 = 1

[State 7211, 8]
type = PlaySnd
trigger1 = !Time
value = S7200,0

[State 7200, 9]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y > -Vel Y
value = 7211
;---------------------------------------------------------------------------
;Bomb Jack Crouch Summon (Land)
[Statedef 7211]
type    = S
movetype= I
physics = N
velset = 0,0
ctrl = 0
anim = 7211
sprpriority = 3

[State 7211, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7211, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7211, 3]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP
stateno = 7230
time = -1

[State 7211, 4]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP
time = 1

[State 7211, 5]
type = PosSet
trigger1 = !Time 
y = 0

[State 7211, 6]
type = ChangeState
trigger1 = !AnimTime
value = 7212
;---------------------------------------------------------------------------
;Bomb Jack Crouch Summon (he hop)
[Statedef 7212]
type    = A
movetype= I
physics = N
velset = 0,-20
ctrl = 0
anim = 7212
sprpriority = 3

[State 7212, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7212, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7212, 3]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP
stateno = 7230
time = -1

[State 7212, 4]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP
time = 1

[State 7212, 5]
type = PlaySnd
trigger1 = !Time
value = S7200,0

[State 7212, 6]
type = ChangeState
trigger1 = ScreenPos Y < -70
value = 7213
;---------------------------------------------------------------------------
;Bomb Jack Crouch Summon (he stomp)
[Statedef 7213]
type    = A
movetype= I
physics = N
velset = 0,0
ctrl = 0
anim = 7213
sprpriority = 3

[State 7213, 2]
type = ScreenBound
trigger1 = 1
value = 0

[State 7213, 3]
type = PlayerPush
trigger1 = 1
value = 0

[State 7213, 4]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP
stateno = 7230
time = -1

[State 7213, 5]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP
time = 1

[State 7213, 6]
type = PosSet
trigger1 = Time = 40
x = enemynear(0), Pos X
y = -200

[State 7213, 7]
type = AssertSpecial
trigger1 = Time < 50
flag = invisible

[State 7213, 8]
type = VelSet
trigger1 = Time = 50
y = 25

[State 7213, 9]
type = StateTypeSet
trigger1 = Time = 50
movetype = A

[State 7213, 10]
type = HitDef
trigger1 = Time = 50
attr = A, SA
damage = ceil(110*root,fvar(21)),28
animtype = Hard
guardflag = MA
hitflag = MAF
priority = 4, Hit
getpower = 0
pausetime = 1,1
sparkno = S6001
sparkxy = -11,0
hitsound = F5, 4
guardsound = F6, 0
ground.type = High
ground.slidetime = 13
ground.hittime  = 16
guard.slidetime = 13
guard.hittime = 13
ground.velocity = 0,25
air.type = High
air.velocity = 0,25
air.hittime = 15
fall = 1
fall.recover = 0
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1
id = 7210
chainID = -1
nochainID = -1
hitonce = 0
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1

[State 7213, 11]
type = Null
triggerall = NumTarget && MoveHit
trigger1 = root,Cond(FVar(20) > .3, FVar(20) := FVar(20) - .2,0) || root,Cond(FVar(21) > .3, FVar(21) := FVar(21) - .2,0)
ignorehitpause = 1
persistent = 0

[State 7213, 12]
type = Gravity
trigger1 = Time >= 50

[State 7213, 13]
type = PlaySnd
trigger1 = Time = 40
value = S7200,1
channel = 3

[State 7213, 14]
type = StopSnd
trigger1 = MoveContact
trigger2 = Pos Y >= -20
channel = 3 

[State 7213, 15]
type = ChangeState
trigger1 = Pos Y >= -20
value = 7204
;---------------------------------------------------------------------------
;Bomb Jack Leave
[Statedef 7220]
type    = A
movetype= I
physics = N
ctrl = 0
velset = -10, -15.13
anim = 7220
sprpriority = 3

[State 7220, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7220, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7220, 3]
type = NotHitBy
trigger1 = 1
value = SCA,AA,AP,AT
time = -1

[State 7220, 4]
type = Gravity
trigger1 = Time >= 14

[State 7220, 5]
type = PlaySnd
trigger1 = !Time
value = S7200,0

[State 7220, 6]
type = ChangeState
trigger1 = BackEdgeDist < -30
value = 7300
;---------------------------------------------------------------------------
;Bomb Jack got a Mighty Hit!
[Statedef 7230]
type    = A
movetype= H
physics = N
velset = 0,0
ctrl = 0
anim = 7230

[State 7230, 1]
type = Gravity
trigger1 = Time >= 2

[State 7230, 2]
type = ParentVarAdd
trigger1 = !Time 
var(6) =  -100
ignorehitpause = 1

[State 7230, 3]
type = PlaySnd
trigger1 = !Time
value = S7230,0
channel = 3

[State 7230, 4]
type = ChangeState
triggerall = Time = 1
trigger1 = root,Var(6) && Vel Y = 0 && Pos Y = 0
value = 7231

[State 7230, 5]
type = ChangeState
triggerall = Time >= 2
trigger1 = root,Var(6) && Vel Y > 0 && Pos Y > -Vel Y
value = 7232

[State 7230, 6]
type = ChangeState
triggerall = Time >= 2
trigger1 = root,Var(6) = 0 && Pos Y > -Vel Y
value = 7240
;---------------------------------------------------------------------------
;Bomb Jack got a Mighty Hit!
[Statedef 7231]
type    = A
movetype= H
physics = N
velset = 0,0
ctrl = 0
anim = 7231

[State 7231, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7231, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7231, 3]
type = NotHitBy
trigger1 = 1
value = SCA,AA,AP,AT
time = -1

[State 7231, 5]
type = StopSnd
trigger1 = Time = 4
channel = 3

[State 7231, 6]
type = ChangeState
trigger1 = Time = 40
value = 7220
;---------------------------------------------------------------------------
;Bomb Jack got a Mighty Hit!
[Statedef 7232]
type    = A
movetype= H
physics = N
velset = 0,0
ctrl = 0
anim = 7231

[State 7232, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7232, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7232, 3]
type = NotHitBy
trigger1 = 1
value = SCA,AA,AP,AT
time = -1

[State 7232, 3]
type = PosSet
trigger1 = !Time
y = 0

[State 7232, 4]
type = PlaySnd
trigger1 = !Time
value = F7,0
channel = 3

[State 7232, 5]
type = EnvShake
trigger1 = !Time
time = 10
freq = 90
ampl = -15

[State 7232, 6]
type = ChangeState
trigger1 = Time = 35
value = 7220
;---------------------------------------------------------------------------
;Bomb Jack Defeated
[Statedef 7240]
type    = L
movetype= H
physics = N
sprpriority = -3
velset = 0,0
anim = 7231
ctrl = 0

[State 7240, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7240, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7240, 3]
type = NotHitBy
trigger1 = 1
value = SCA,AA,AP,AT
time = -1

[State 7240, 4]
type = AssertSpecial
triggerall = Time >= 40
trigger1 = (GameTime % 2) = 0
flag = invisible

[State 7240, 4]
type = PosSet
trigger1 = !Time
y = 0

[State 7240, 5]
type = PlaySnd
trigger1 = !Time
value = F7,0

[State 7240, 6]
type = EnvShake
trigger1 = !Time
time = 10
freq = 90
ampl = -15

[State 7240, 5]
type = DestroySelf
trigger1 = Time = 70
;---------------------------------------------------------------------------
;Helper Gone
[Statedef 7300]
type    = U
movetype= H
physics = N
ctrl = 0
anim = 1
velset = 0,0
sprpriority = 3

[State 7300, 1]
type = ParentVarSet
trigger1 = Var(11) = Var(10)
var(39) = 0
ignorehitpause = 1

[State 7300, 2]
type = ParentVarSet
trigger1 = !Time
var(38) = 0
ignorehitpause = 1

[State 7300, 3]
type = DestroySelf
triggerall = !(root,Var(38)) && !(root,Var(39))
trigger1 = !NumTarget && Anim = 1
trigger2 = NumTarget && Anim = 1
trigger2 = target,StateType = L

